<%--
  Created by IntelliJ IDEA.
  User: xiong
  Date: 2020/7/12
  Time: 0:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<link rel="stylesheet" type="text/css" href="layui/css/layui.css">
<script src="layui/layui.js"></script>
<script src="js/jquery-3.5.1.min.js"></script>

<html>
<head>
    <title>订单列表</title>
</head>
<style>
    .mytable{
        width: 60%;
    }

    body table{
        width: 30%;
    }
</style>
<body>
<div class="layui-main main">
    <div class="layui-row" >
        <table class="layui-table mytable">

            <colgroup>
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>订单ID</th>
                <th>订单编号</th>
                <th>下单用户</th>
                <th>下单时间</th>
                <th>支付金额</th>
                <th>进行操作</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${orders}" var="order">

                <c:set var="orderid" value="${order.id}" scope="request"/>
                <%
                    int oid = (Integer)request.getAttribute("orderid");
                %>
                <tr>
                    <td>${order.id}</td>
                    <td>${order.orderno}</td>
                    <td>${order.uid}</td>
                    <td>${order.ordertime}</td>
                    <td>${order.price}</td>
                    <td><a href="/orderDetail.jsp?oid=<%=oid%>">查看详情</a></td>

                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>
